-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
jwt-cpp: fix building without picojson #12735
Conversation
This comment has been minimized.
This comment has been minimized.
@SpaceIm @prince-chrismc, not sure what to do with test_package, can you please clarify what is the right way to deal with it? |
Make sure to comment in #4 🙏 |
Add the header |
@JorgenPo PLease, dont forget to sign the CLA pointed in this PR. |
This comment has been minimized.
This comment has been minimized.
@prince-chrismc, done! |
Signed-off-by: Uilian Ries <uilianries@gmail.com>
@JorgenPo Please, consider JorgenPo#1 It will prepare jwt-cpp recipe for Conan 2.0 |
Adapt for Conan 2.0
This comment has been minimized.
This comment has been minimized.
@uilianries, merged your PR |
recipes/jwt-cpp/all/conanfile.py
Outdated
tools.patch(**patch) | ||
get(self, **self.conan_data["sources"][self.version], | ||
destination=self.source_folder, strip_root=True) | ||
apply_conandata_patches(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply_conandata_patches(self) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied suggested change
recipes/jwt-cpp/all/conanfile.py
Outdated
basic_layout(self, src_folder="src") | ||
|
||
def build(self): | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pass | |
apply_conandata_patches(self) |
Doing a new try, it works when using no_copy_source
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
recipes/jwt-cpp/all/conanfile.py
Outdated
@@ -27,21 +27,26 @@ def export_sources(self): | |||
def requirements(self): | |||
self.requires("openssl/1.1.1q") | |||
if not self._supports_generic_json: | |||
self.requires("picojson/1.3.0") | |||
self.requires("picojson/cci.20210117") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to point to official releases when they are available
self.requires("picojson/cci.20210117") | |
self.requires("picojson/cci.1.3.0") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -1,4 +1,5 @@ | |||
#include <jwt-cpp/jwt.h> | |||
#include <jwt-cpp/traits/kazuho-picojson/defaults.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this only exists in 0.6.0 +
You'll need to drop older versions 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some additional definitions to the test package and placed picojson traits files to the test package folder to be able to compile older jwt-cpp versions.
Tested building on all versions listed in conandata.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How am I supposed to use this package now? Why do you want me to copy-paste these files as well, instead of just changing _supports_generic_json to version >= 6.0. I see no reason why we want to define JWT_DISABLE_PICOJSON in the recipe.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not an example, the test package is more complicated because it's supporting many versions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you use version 0.6.0 you can include any of the support JSON libraries and that file will already be present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated 0.5.0 to new revision and it became not usable because of hard coded define :(
I had to upgrade to 0.6.0 and slightly adjust my code, now it is working. But I still think setting this define without option flag was a bad decision. It turns off part of the functionality of the library which I was using in the previous revision.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/Thalhammer/jwt-cpp/releases did add support for generic json at 0.5.0 but I agree this could be improved #12735 (review)
Feel free to open a PR to improve the recipe :)
This PR is trying to do a lot 🙈 sorry everything is getting tossed in |
This comment has been minimized.
This comment has been minimized.
@prince-chrismc, @uilianries, fixed all review comments, could you have a look please? |
@JorgenPo Waiting for the CI result ... It's taking more time usual. Your PR looks good now. |
All green in build 5 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not crazy for copy pasting files that exist but the solution is pretty complicated and we want this for 2.0
I'll circle back to work on it
* jwt-cpp: fix building without picojson * jwt-cpp: add missing traits header to test package * Adapt for Conan 2.0 Signed-off-by: Uilian Ries <uilianries@gmail.com> * Fix building test_package for older jwt-cpp versions * Conanfile review fixes * Add endline to the end of files Signed-off-by: Uilian Ries <uilianries@gmail.com> Co-authored-by: Uilian Ries <uilianries@gmail.com>
Specify library name and version: jwt-cpp/0.6.0
Fix compilation of jwt-cpp without picojson library
Fixes #12706